package org.stephen;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * ClassName: RecommendApplication
 * Description:
 * Date: 2020/12/8 20:38
 *
 * @author stephen.qiu
 * @version 1.0
 */

@SpringBootApplication
@EnableScheduling
@MapperScan(value = "org.stephen.recommend.mapper")
@ComponentScan({"org.stephen.recommend.*"})
public class RecommendApplication {
    public static void main(String[] args) {
        try {
            SpringApplication springApplication = new SpringApplication(RecommendApplication.class);
            springApplication.run(args);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        paginationInterceptor.setDialectType("mysql");
        return paginationInterceptor;
    }

}
